<volist name="lists" id="vo">
  <!--本地测试开始-->
  <table class="order-detail-table">
    <thead>
      <tr>
        <th class="column-info" colspan="7">
          <div class="column-content">
            <if condition="$vo['order_types'] eq 2 ">
              <front style="background: #f2966e;border-radius: 10px;color:#fff;padding:3px 5px">团购</front>
            </if>
            下单时间：{$vo.create_time|time_format}<span class="split"></span>
            配送至：{$vo.ship.ship_area}{$vo.ship.ship_address}<span class="split"></span>
            订单号：{$vo.order_sn}<span class="split"></span>
            <span>
              <if condition="I('type') eq 'recycle'">
                <a href="javascript:;" class="btn-cancel J_order_delete" data-id="{$vo.id}" title="删除订单"><i class="icon icon-remove"></i></a>
              <else/>
              <switch name="vo.o_status">
                <case value="-1|303|404">
                  <if condition="I('type') neq 'recycle'">
                    <a href="javascript:;" class="btn-cancel J_order_recycle" data-id="{$vo.id}" title="删除到回收站"><i class="icon icon-remove"></i></a>
                  </if>
                </case>
              </switch>
              </if>
            </span>   
          </div>
        </th>
      </tr>
    </thead>
    <tbody>
      <volist name="vo.OrderList" id="data" key="k">
      <tr>
        <td class=" col-xs-4 column-detail">
          <foreach name="data.OrderItem" item="item">
            <elt name="key" value="3">
              <a href="{:U('Item/detail', array('id' => $item['item_id']))}" class="pic" title="{$item.name}" alt="{$item.name}" target="_blank">
                <img src="{:get_image_thumb($item['cover_path'], 60, 60)}" width="58">
              </a>
            </elt>
            <php>
              if(!in_array($item['item_id'], $item_ids)){
                $item_ids[] = $item['item_id'];
                $show_comment_btn += $item['is_comment'];
              }
            </php>
          </foreach>
          <if condition="count($data['OrderItem']) gt 4">
            <i class="item-more" title="订单中还有其他商品...">···</i>
          </if>                                          
        </td>
        <if condition="$k eq count($vo.OrderList)">
          <td class="col-xs-3 text-center" rowspan="{:count($vo['OrderList'])}"><span class="text-danger">¥ {:sprintf('%.2f', $vo['total_amount']+$vo['finance_amount'])}</span></td>
        </if>  
        <td class="col-xs-3 text-center column-action text-center color-999">
            <em class="msg">{:get_order_status_text($data['o_status'])}</em>
            <switch name="data.o_status">
              <case value="200">
              <empty name='data.refuse_message' >
                <em class="msg"><a href="javascript:;" class="btn btn-sm J_order_refund" data-id="{$data.id}">申请售后</a></em>
              </empty>
              </case>
              <case value="201">
              <empty name='data.refuse_message' >
                <em class="msg"><a href="javascript:;" class="btn btn-sm J_order_refund" data-id="{$data.id}">申请售后</a></em>
              </empty>
                <em class="msg" style="margin-top: 10px;"><a href="javascript:;" class="btn btn-positive btn-sm J_order_confirm" data-id="{$data.id}">确认收货</a></em>
              </case>
              <case value="202">
                  <empty name='data.refuse_message' >
                  <if condition="$data.complete_time gt time()-C('MAX_REFUND_CASH_DAY')*24*3600">
                  <em class="msg"> <a href="javascript:;" class="btn btn-sm J_order_refund" data-id="{$data.id}">申请售后</a></em>
                </if>
              </empty>
                <!-- <if condition="$show_comment_btn != count($item_ids)">
                <a href="{:U('Order/detail', array('order_sn' => $vo['order_sn']))}" class="btn btn-sm btn-positive" target="_blank"><i class="icon icon-appreciate"></i> 立即评价</a>
                </if> -->
              </case>
              <case value="300">
                <em class="msg"> <a href="javascript:;" class="btn btn-sm J_order_unrefund" data-id="{$data.id}">撤销售后申请</a></em>
              </case>
              <case value="301">
                <a href="javascript:;" class="btn btn-sm btn-positive J_order_reship" data-id="{$data.id}">立即退货</a>
              </case>
              <case value="302">
                <a class="btn-sm" href="javascript:$.ui.load('{:U('Order/reShip',array('order_id' => $data['id']))}','退货物流信息');">退货物流</a>
              </case>
              <case value="405">
                <em class="msg"> <a href="javascript:;" class="btn btn-sm J_order_refund" data-id="{$data.id}">申请售后</a></em>
              </case>
            </switch>
            <if condition="($data['o_status'] eq 405) AND ($data['shipping_time'] gt 0)">
              <em class="msg" style="margin-top: 10px;"><a href="javascript:;" class="btn btn-positive btn-sm J_order_confirm" data-id="{$data.id}">确认收货</a></em>
            </if>
            <if condition="in_array($data['o_status'], array(201, 202))">
                <em class="msg"><a href="javascript:$.ui.load('{:U('Order/getDelivery?order_id='.$data['id'])}', '物流配送信息');" class="btn btn-sm">查看物流</a></em>
            </if>               
        </td>
        <if condition="$k eq count($vo.OrderList)">
          <td class="column-action col-xs-3 " rowspan="{:count($vo['OrderList'])}">
            <div class="text-center order-info order-action">
              <eq name="data.o_status" value="0">
                <a href="{:U('Order/preview', array('order_sn' => $vo['order_sn']))}" class="btn btn-sm btn-positive"> 立即支付</a><br/>
                <a href="javascript:;" class="btn btn-sm btn-default J_order_cancel" id="cancleBtn" data-id="{$vo.id}" title="取消订单"> 取消订单</a>
              </eq>
              <br/><a href="{:U('Order/detail', array('order_sn' => $vo['order_sn']))}" class="btn btn-sm btn-default" target="_blank">查看详情</a>
            </div>
            <if condition="I('type') eq 'recycle' ">
              <em class="msg"><a href="javascript:;" class="btn-cancel btn-sm J_order_restore" data-id="{$vo.id}" title="还原订单">还原订单</a></em>
            </if>
          </td> 
        </if>     
      </tr>
    </volist>
    </tbody>
  </table>
</volist>